package com.yyl.rbacs.utils;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @BelongsProject: rbacs
 * @BelongsPackage: com.yyl.rbacs.utils
 * @Author: YuanSir
 * @CreateTime: 2022-10-31  13:41
 * @Description:
 * @Version: 1.0
 */


@Data
@NoArgsConstructor
public class PageVo<T> {
    
    private Long totalCount;
    
    private Long pageSize;
    
    private Long totalPage;
    
    private Long currPage;
    
    private List<T> list;
    
    public PageVo(Page<T> page) {
    
        this.totalCount = page.getTotal();
        
        this.pageSize = page.getSize();
        
        this.totalPage = page.getPages();
        
        this.currPage = page.getCurrent();
        
        this.list = page.getRecords();
    
    }
}
